home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / gamesrc / fring11 / readme.txt < prev   
Text File  |  1992-12-17  |  15KB  |  448 lines

  1.                         READ.ME FILE
  2.            FRINDGUS (An incomplete game) (14/11/92)
  3.            ----------------------------------------
  4.              By Jason Nunn (JsNO BAR----NUNN)
  5.                  nunn@pandanus.cs.ntu.edu.au
  6.  
  7.     (Note: This is a quick "slap-up" documentation, I'll do
  8.            a better job later.....but for now)
  9.  
  10.  
  11.                         A VGA GAME
  12.                         ----------
  13.  
  14.  Hello,
  15.  
  16.  
  17. I started this game "FringDus" a couple of months ago. Due
  18. to the fact that I've completed my degree (hence unemployed),
  19. I have to find a job. I'm also nackered after my computing
  20. project which clocked up 25000 lines of Pascal code in 10
  21. weeks and MONTANUS is still isn't finished!.
  22.  
  23.   Basically I'm getting too old for this sort of stuff,
  24. and now giving it to someone else; the idea's and concepts
  25. to write a game. Another reason why I'm "throwing it in",
  26. is because I have absolutely NO artistic talent what's
  27. so ever!. When it comes to programming, I'm good, but when it
  28. comes to designing graphics- I'm absolutely shithouse.
  29.  
  30. All code is totally freeware. YOU CAN DIRECTLY USE THIS CODE
  31. IN GAMES ETC.
  32.  
  33.  
  34.                           LEGALS
  35.                           ------
  36.  
  37.  - I do not take any responibility of any hardware/software
  38. loss or any other loss that is the direct/indirect consequence
  39. of seeing/using this code/executables.
  40.  
  41. (To my knowledge, this code is completely safe. The only
  42. reason I'm giving this warning it because everybody else
  43. does!.)
  44.  
  45. - You may freely use is code. You may use it directly in your
  46. source, even if you make Millions of Dollars on a game you made
  47. using this code. It only took me a night to write the basic code
  48. so it's no skin off my nose (I took me alot longer to design the
  49. graphics though!).
  50.  
  51.  
  52.                         DISTRIBUTION
  53.                         ------------
  54.  
  55. This distribution comes with:
  56.  
  57.    fringdus.pas   <game source>
  58.    pic_make.pas   <sprite maker source>
  59.    map_mak2.pas   <map maker source for editing the FRING1.MAP file>
  60.    pack.pas       <transforms *.PIC (sprite graphics) to
  61.                    the FRINGPC1.PIC file>
  62.  
  63.    fringdus.exe   <the excutables>
  64.    pic_make.exe
  65.    mak_mak2.exe
  66.    pack.exe
  67.    pack.ini       <the pic list that pack reads to dtermine which
  68.                    pic files to append to "fringpc1.pic">
  69.  
  70.    flr1.pic thru to-
  71.    flr32.pic      <the individual sprites>
  72.  
  73.    b_scr.bmp      <The base screen file (in windows format)>
  74.  
  75.    bs.bat         <Boot scrap compiling sequence, with the relevent
  76.                    flags etc>
  77.  
  78.  
  79.               Very Techical Notes & Discussion Notes
  80.               --------------------------------------
  81.  
  82. FRINGDUS.PAS:
  83. -------------
  84.  
  85. Have you ever heard of Paradroid?. It was a game I used
  86. to play on a friends C-64 a long time ago (1987). I reckon
  87. it was the best game ever written. Fringdus has the same
  88. scrolling effect of the graphics as Paradroid. It looks really
  89. good!, I'm really impressed with what I have done. As you operate
  90. the key-pad keys, it looks like the "ground floor" is moving
  91. under you. It looks very smooth, but still needs some
  92. modifications so that it is faster. The computing solutions are
  93. the first solvable solutions, not the best ones.
  94.  
  95. Basically, the code that resides in the Pascal source:
  96. "FringDus.pas" is like a Database Manager. It manages a
  97. 2 entity 1-N relational database. The ERD (Entity
  98. Relationship Diagram) is below:
  99.  
  100.  
  101.  
  102.                          ^
  103. ----------------        / \        ---------------
  104. |              |   1   /   \   N   |             |
  105. | FRINGPC1.PIC |------/ HAS \----->| FRING1.MAP  |
  106. |              |      \     /      |             |
  107. ----------------       \   /       ---------------
  108.                         \ /
  109.                          .
  110.  
  111.  
  112. It copies blocks of graphics contained of the "FRINGPC1.PAS"
  113. (FRINGdus PiCture 1) file (which is stored in memory), according
  114. to what the "FRING1.MAP" tells it (also stored in memory). The
  115. "FRING1.MAP" file is really the "map of the floor", which only
  116. contains position references to the blocks of graphics in the
  117. "FRINGPC1.PAS" file.
  118.  
  119. (Note/ From now on, we'll call the blocks of graphics: "Sprites"-
  120. from my good old C-64 days :) ).
  121.  
  122. When "Fringdus.exe" is executed, the computer reads a
  123. section of the "FRING1.MAP", It reads the relative locations
  124. of the sprites in the "fringpc1.pic file. It then reads the
  125. sprite and then copies it the video memory located at decimal
  126. address 40960 (A000h). The screen dimensions for Fringdus are:
  127. 320*200 pixels (or 64K of memory).
  128.  
  129. (Note that this for VGA only. You will have to make the relevent
  130. changes to the code to turn it in to a EGA or CGA game.)
  131.  
  132. Fringdus provides a quick assembly base to copy chucks of data
  133. to the video (invisible) memory. As you will see, many of these
  134. assembly routines are tailor made for certain situtions.
  135. The problem is with graphic libraries is that they are standardised.
  136. The problem with standardised anythings, is that they compensate
  137. for any kind of situation (philosophically speaking). Hence they are
  138. slow. If you want speed, you need to custom make routines for only
  139. certain situtions in assembly. Disassembled 3GL's like Pascal are
  140. very Stack intensive. There is alot of overhead in preparing values
  141. for the registers. Analagously, they "have a few drinks, watch a
  142. few porn's, have a couple of games of pool, then go to sleep" before
  143. they do they they useful. With assembly, you can "contain" the
  144. processing, within the action registers AX, DX, CX, BX, so that
  145. processing is very fast.
  146.  
  147. These routines are in no way efficient. I don't consider myself an
  148. assembly expert. An assembly expert will look at these routines and
  149. speed them up by 5 times, because they know what intructions are fast
  150. and what instructions are slow. A lot can be said about Assembly
  151. experts, but we won't go in to that now.
  152.  
  153.  
  154. NB/  A detailed look at how they work, is in the source documentation.
  155. If your still having problems with how they work, write me. I haven't
  156. documented them properly, but will. Remember!, I might be documenting
  157. for a living, so please remember that cooks don't like cooking when
  158. they get home :).
  159.  
  160.  
  161.   The sprites are 30 pixels by 30 pixels, as follows:
  162.  
  163.  
  164.                         (NOT TO SCALE)
  165.  
  166.  
  167.                              30 X
  168.                 -------------------------------
  169.                 |    o        o       o       |
  170.              3  |   o o      o o     o o      |
  171.              0  |    o        o       o       |
  172.                 |    o        o       o       |
  173.              X  | oooooooooooooooooooooooooo  |
  174.                 |    o        o       o       |
  175.                 |    o        o       o       |
  176.                 |    o        o       o       |
  177.                 |   o o      o o     o o      |
  178.                 |  o   o    o   o   o   o     |
  179.                 | o     o  o     o o     o    |
  180.                 -------------------------------
  181.  
  182.  
  183.  
  184. Each pixel (due to being VGA) consists of 1 byte to define it.
  185. As said before, these will get copied to the memory block:
  186. 40,960-106,495 (320*200 256 colour). These sprites are 900 bytes
  187. in length. I don't know why I chose 30x30. It looked a pretty
  188. optimal matrix. As you move smaller blocks, you get a high CPU
  189. load but the less blocks you have to store, the more diversifable
  190. grpahics you have because you can make more graphics with smaller 
  191. blocks. As you move bigger blocks, copying becomes more efficient, 
  192. BUT you need alot of memory to have a diversifed array of graphics.
  193.  
  194.  
  195. Fringdus reads the fring1.map (now in memmory), to determine what
  196. sprites to copy. It looks simliar to this:
  197.  
  198.  
  199.  
  200.                     (AGAIN, NOT TO SCALE)
  201.  
  202.  
  203.                         100 X
  204.             --------------------------------------
  205.            |   shhhhu                             |
  206.          1 |   d    d       aaaaau                |
  207.          0 |   d    d            d                |
  208.          0 |   d    d            d                |
  209.            |   d    d            d                |
  210.          X |   hffffl            d                |
  211.            |                     d                |
  212.            |                     d                |
  213.            |                     d                |
  214.            |                     d                |
  215.             --------------------------------------
  216.  
  217.  
  218. It is a 100x100 bytes. Each byte presents a sprite. As you may be
  219. wondering, this is a huge area. In real terms it is 3000*3000 pixels.
  220. Again, each byte contains a reference to a given sprite in the
  221. "fringpc1.pic" file. For example, if the value of a given
  222. position in the above map was say "4" (the 5th sprite), then
  223. the position of the fifth sprite would be at offset 4 * 900 =
  224. 3600...simple. It would go to postion 3600, copy 900 bytes
  225. from that offset, and then paste it to the screen (in a simple
  226. sense).
  227.  
  228.  
  229.   35 sprites are copied on the screen to define the floor surface,
  230. starting at coorinates (50,30). It look as follows:
  231.  
  232.  
  233.                     (NOT TO SCALE)
  234.  
  235.  
  236.                 -----------------------
  237.                 |   /- starts at 50,30|
  238.                 |   |                 |
  239.                 |   x x x x x x x x   |
  240.                 |                     |
  241.                 |   x x x x x x x x   |
  242.                 |                     |
  243.                 |   x x x x x x x x   |
  244.                 |                     |
  245.                 |   x x x x x x x x   |
  246.                 |                     |
  247.                 |   x x x x x x x x   |
  248.                 |     ^ sprites       |
  249.                 -----------------------
  250.  
  251.  
  252. If the sprites are not at their discrete postions, they will be
  253. scrolled. The assembly algo's, cut the border sprites so that
  254. they don't leak out from the painting area (this unfortunatly,
  255. takes up alot of O/H).
  256.  
  257. The key-pad keys, change the value of a marginal dx & dy values
  258. that change the value of the real x & y values. These values
  259. determine what sprites to copy when compared with the map file
  260. (fring1.map). For example, if real x and real y were 244 and
  261. 345 respectively then fringdus will refer to the map file at
  262. postions:
  263.  
  264.   x: (244 / 30)  thruto   (244 / 30) + 7
  265.  
  266.   y: (345 / 30)  thruto   (345 / 30) + 5
  267.  
  268. When "mod"'ed (eg X mod 30, Y mod 30), they determine the degree
  269. of scroll from the offset discrete position of a given sprite.
  270.  
  271.  
  272.   The operation keys are as follows:
  273.  
  274.  
  275.                    home    pgup
  276.                      \  |  /
  277.  
  278.                     -       -    (key pad)
  279.  
  280.                     /   |  \
  281.                    end     pgdn
  282.  
  283.  
  284. PIC_MAKE.PAS:
  285. -------------
  286.  
  287. I had to make my own sprite graphics program to make the sprites.
  288. The code is obvious, therefore I'm only going to briefly explain
  289. it here.
  290.  
  291. This program makes a 30x30 256 colour sprite that PACK.EXE will
  292. pack into "fringpc1.pic".
  293.  
  294. To execute this utility type in:
  295.  
  296.  
  297. Command: PIC_MAKE <sprite file>
  298.  
  299.  
  300. NB/ You don't have to have the PIC extension, it can be anything you
  301. like.)
  302.  
  303.  
  304.   The operation keys are:
  305.  
  306.                         |
  307.  
  308.                     -       -    (key pad)
  309.  
  310.                         |
  311.  
  312.   Enter Key: To write a pixel in the sprite the selected colour.
  313.  
  314.   -: GO up one colour
  315.   +: Go down one colour
  316.  
  317.   /: Go up 10 colours
  318.   *: Go down 10 colours.
  319.  
  320.   `: Fload full sprite with colour
  321.  
  322.   Esc: Exit (Abend)
  323.  
  324.   s: save present sprite
  325.   f: flip sprite and save (flips vertically)
  326.   t: turn sprite and save (flips horzontally)
  327.  
  328.  
  329. Once you have composed something, then you ever hit 's' for save or
  330. 'f' or 't' to save. Once saved, then you hit 'Esc' to exit.
  331.  
  332. The reason for the 'f' and 't', is that it saves you alot of work
  333. recomposing a drawing that that only needs to be "turned around" etc.
  334. If you want a mirror image of something, just create a clone copy
  335. of the sprite you want to flip or turn (eg IN DOS:
  336. copy jas1.pic jas2.pic), then load it up (eg pic_make jas2.pic). Once
  337. loaded, you can turn or flip it with the appropriate 'f' or 't' key.
  338. Once done- hit 'esc'.
  339.  
  340. PACK.PAS:
  341. ---------
  342.  
  343. Creates the "fringpc1.pic" file whichs contains the sprites that
  344. Fringdus reads. Pack read a list of pic files (*.pic - doesn't have
  345. to have the PIC extension, it can be anything) and then appends them
  346. to "fringpc1.pic".
  347.  
  348. command: PACK
  349.  
  350. Once executed, pack reads the 'PACK.INI' file, and moves/appends the
  351. files that are in this directive file, to the 'fringpc1.pic'.
  352.  
  353.  
  354. MAP_MAK2.PAS:
  355. -------------
  356.  
  357. This program edits the map file: "fring1.map". There was a
  358. map_make.pas, but that was an initiating program that was really
  359. shity. This program allows you to change the sprite references-
  360. hence the sprites to be displayed.
  361.  
  362. To execute, type in:
  363.  
  364. Command: map_mak2
  365.  
  366.  
  367.  
  368.   The Operation keys are:
  369.  
  370.                         |
  371.  
  372.                     -       -    (key pad)
  373.  
  374.                         |       :This is a block scroll
  375.  
  376.  
  377.  
  378.                         i
  379.  
  380.                     j       k   :Once positioned with keypad, you
  381.                                  move around with these keys
  382.                         m
  383.  
  384.  
  385.    enter: When you want to change a value in the map file matrix
  386.           simply hit this key. You then enter in the new value.
  387.           If you were repeating the same value (the same value last
  388.           entry), then just hit enter without entering in the value
  389.           again- this makes entring data alot faster (and less
  390.           frustrating).
  391.  
  392.    s: 's' saves fring1.map. Once saved, it immediately exits.
  393.  
  394.  
  395. bs.bat:
  396. -------
  397. Boot strap compiler sequence. With tpc (Borland Turbo Pascal V6) in
  398. your path just type in: bs. Fringdus will be built with the relavent
  399. compiler flags.
  400.  
  401.  
  402.  
  403. b_scr.bmp:
  404. ----------
  405.  
  406. The base screen. Fringdus writes this file in video memory initially.
  407. You can edit it this file to your needs using windows "paint Brush"
  408. for example.
  409.  
  410. (Note, I don't know the BMP format, I've just took a rough stab, just
  411. by displaying BMP's raw, and determining the format. Please send me 
  412. the correct BMP format)
  413.  
  414. *.pic:
  415. ------
  416.  
  417. The Individual sprite files before being packed.
  418.  
  419.  
  420.  
  421.  
  422. Enjoy :). Feel free to contact me if you don't understand something,
  423. or can't that something working.
  424.  
  425.  
  426.                                ooo0ooo
  427.  
  428. -----------------------------------------------------------------------------
  429.                               JsNO BAR----NUNN
  430.  
  431.          Spelling Disclaimer: "MY SUN keyboard is a chunk of shit"
  432.  
  433.    "Computer Science students learn how to become computing professionals,
  434.    Business Information Systems students are users learning about themselves"
  435.                               NTU, DARWIN, OZ
  436.                         nunn@pandanus.cs.ntu.edu.au
  437. -----------------------------------------------------------------------------
  438.  
  439.  
  440.   or
  441.   snail:
  442.  
  443.     8 Winton Street,
  444.     Jingili, Darwin,
  445.     NORTHERN TERRITORY,
  446.     0810,
  447.     AUSTRALIA.
  448.